<?php

use Vinlon\Laravel\LayAdmin\SideBar;
use Vinlon\Laravel\LayAdmin\SideBarCollection;

$sidebars = new SideBarCollection();

/* 在此处定义应用菜单 */

$sidebars->add(
    SideBar::create('store', '门店管理')->iconClass('layui-icon-transfer')->jumpTo('store/index')
);
$sidebars->add(
    SideBar::create('user', '用户管理')->iconClass('layui-icon-user')
        ->add(SideBar::create('user.list', '用户列表')->jumpTo('user/index'))
        ->add(SideBar::create('user.channel', '渠道商列表')->jumpTo('user/channel'))
        ->add(SideBar::create('user.login_history', '登录历史')->jumpTo('user/login_history'))
        ->add(SideBar::create('user.settings', '设置')->jumpTo('user/settings'))
);
$sidebars->add(
    SideBar::create('product', '商品管理')->iconClass('layui-icon-note')
        ->add(SideBar::create('product.category', '商品品类')->jumpTo('product/category'))
        ->add(SideBar::create('product.list', '发行商品')->jumpTo('product/index'))
        ->add(SideBar::create('product.blind_box', '肓盒商品')->jumpTo('blind_box/index'))
        ->add(SideBar::create('product.resale', '转售商品')->jumpTo('product/resale'))
        ->add(SideBar::create('product.give', '转赠记录')->jumpTo('product/give'))
        ->add(SideBar::create('product.settings', '设置')->jumpTo('product/settings'))
);

$sidebars->add(
    SideBar::create('activity', '活动管理')->iconClass('layui-icon-fire')
        ->add(SideBar::create('activity.invite', '邀请活动')->jumpTo('invite/index'))
        ->add(SideBar::create('activity.airdrop', '商品空投')->jumpTo('airdrop/index'))
        ->add(SideBar::create('activity.airdrop_blind_box', '盲盒空投')->jumpTo('airdrop/blind_box'))
        ->add(SideBar::create('activity.lottery', '抽奖')->jumpTo('lottery/index'))
        ->add(SideBar::create('activity.convert', '合成')->jumpTo('convert/index'))
);

$sidebars->add(
    SideBar::create('rights', '权益管理')->iconClass('layui-icon-diamond')
        ->add(SideBar::create('rights.keys', '虚拟权益')->jumpTo('rights/keys'))
        //->add(SideBar::create('rights.delivery', '实物权益')->jumpTo('rights/delivery'))
        ->add(SideBar::create('rights.entity', '实物权益')->jumpTo('rights/entity'))
        ->add(SideBar::create('rights.apply', '兑付申请')->jumpTo('rights/apply'))
);

$sidebars->add(
    SideBar::create('order', '订单管理')->iconClass('layui-icon-cart')
        ->add(SideBar::create('order.list', '发行订单')->jumpTo('order/index'))
        ->add(SideBar::create('order.resale', '转售订单')->jumpTo('order/resale'))
        ->add(SideBar::create('order.blind_box', '肓盒订单')->jumpTo('order/blind_box'))
        ->add(SideBar::create('order.settings', '设置')->jumpTo('order/settings'))
);

$sidebars->add(
    SideBar::create('business', '运营工具')->iconClass('layui-icon-util')
        ->add(SideBar::create('business.auto_lock_task', '自动锁单')->jumpTo('business/auto_lock_task'))
        ->add(SideBar::create('business.lock_order', '手动锁单')->jumpTo('business/lock_order'))
        ->add(SideBar::create('business.batch_pay', '批量购买')->jumpTo('business/batch_pay'))
        ->add(SideBar::create('business.batch_resale', '批量转售')->jumpTo('business/batch_resale'))
);
# 功能没有用到，暂时隐藏
//$sidebars->add(
//    SideBar::create('registry', '登记管理')->iconClass('layui-icon-tabs')
//        ->add(SideBar::create('registry.list', '登记列表')->jumpTo('registry/index'))
//        ->add(SideBar::create('registry.price', '价格设置')->jumpTo('registry/price'))
//);

$sidebars->add(
    SideBar::create('message', '消息中心')->iconClass('layui-icon-notice')
        ->add(SideBar::create('message.notice', '系统公告')->jumpTo('message/notice'))
        ->add(SideBar::create('message.message', '站内信')->jumpTo('message/message'))
);

$sidebars->add(
    SideBar::create('ops', '运维管理')->iconClass('layui-icon-set-fill')
        ->add(SideBar::create('ops.settings', '参数配置')->jumpTo('ops/settings'))
        ->add(SideBar::create('ops.website', '网站设置')->jumpTo('ops/website'))
        ->add(SideBar::create('ops.banner', 'BANNER设置')->jumpTo('ops/banner'))
        ->add(SideBar::create('ops.download', '下载中心')->jumpTo('ops/download'))
);

$sidebars->add(
    SideBar::create('_my', '我的')->iconClass('layui-icon-username')
        ->add(SideBar::create('_my.profile', '基本资料')->jumpTo('_base/user/user/info'))
        ->add(SideBar::create('_my.password', '修改密码')->jumpTo('_base/user/user/password'))
);

return [
    /*
     * Admin页面Route Prefix
     * 默认值： admin, 此时管理页面访问地址为 http://localhost:8000/agent
     */
    'route_prefix' => env('LAY_AGENT_ADMIN_ROUTE_PREFIX', 'agent'),

    /*
     * 自定义middleware
     */
    'middleware' => [
        //        \App\Http\Middleware\XssDefense::class,
    ],

    /*
     * 菜单定义
     */
    'sidebars' => $sidebars->toArray(),

    /*
     * 角色定义类
     */
    'role_class' => \App\AdminRoleExtend::class,
];
